$(document).ready(function()
{
	$("#subbtn").click(function()
	{
		alert("I work");
		var product_category = $('#pcat').val();
		var product_description = $('#pdesc').val();
		
		var added_on = $('#added_on').val();
		var added_by = $('#added_by').val();
		
		
		var dataString = 'pc='+ product_category + '&pd='+ product_description + '&ao='+ added_on + '&ab='+ added_by + '&ft=addcat';
		
		$.ajax
		({
			type: "POST",
			url: "controller/save.php",
			data: dataString,
			cache: false,
			success: function(html)
			{
			$("#saveResult").html(html);
			
		
		} 
		});
	
	});
	
	
	
	
	
	$("#subbtn2").click(function()
			{
	
				var product_category = $('#pcat').val();
				var product_description = $('#pdesc').val();
				
				var added_on = $('#added_on').val();
				var added_by = $('#added_by').val();
				
				
				var dataString = 'pc='+ product_category + '&pd='+ product_description + '&ao='+ added_on + '&ab='+ added_by + '&ft=addproduct';
				
				$.ajax
				({
					type: "POST",
					url: "controller/save.php",
					data: dataString,
					cache: false,
					success: function(html)
					{
					$("#saveResult").html(html);
				
				} 
				});
	
			});

});
